import request from '@/utils/request'

// 查询工位信息列表
export function listWorkstation(query) {
    return request({
        url: '/mes/workstation/list',
        method: 'get',
        params: query
    })
}

// 查询工位信息详细
export function getWorkstation(workstationId) {
    return request({
        url: '/mes/workstation/' + workstationId,
        method: 'get'
    })
}

// 新增工位信息
export function addWorkstation(data) {
    return request({
        url: '/mes/workstation',
        method: 'post',
        data: data
    })
}

// 修改工位信息
export function updateWorkstation(data) {
    return request({
        url: '/mes/workstation',
        method: 'put',
        data: data
    })
}

// 删除工位信息
export function delWorkstation(workstationId) {
    return request({
        url: '/mes/workstation/' + workstationId,
        method: 'delete'
    })
}

// 校验工位编码唯一性
export function checkWorkstationCodeUnique(data) {
    return request({
        url: '/mes/workstation/checkWorkstationCodeUnique',
        method: 'post',
        data: data
    })
}

// 查询启用状态的工位列表
export function selectActiveWorkstationList() {
    return request({
        url: '/mes/workstation/selectActiveWorkstationList',
        method: 'get'
    })
}

// 根据车间ID查询工位列表
export function selectMesWorkstationByWorkshopId(workshopId) {
    return request({
        url: '/mes/workstation/selectMesWorkstationByWorkshopId/' + workshopId,
        method: 'get'
    })
}